export interface GetUserListApiParams {
  page: number;
  limit: number;
  username: string;
}
/*
 {
    "total": 11,
    "items": [
      {
        "id": "string",
        "gmtCreate": "2022-11-30 20:58:42",
        "gmtModified": "2022-11-30 20:58:42",
        "deleted": false,
        "username": "8585",
        "password": "ed556265816011ba76a53e5cf54450cf",
        "nickName": "888",
        "salt": "string",
        "token": "string",
        "roleName": "平台管理员,品牌管理员,超级管理员,admin,产品总监"
      }
    ]
  }
*/

export interface UserItem {
  id: string;
  gmtCreate: string; // 创建时间
  gmtModified: string; // 修改时间
  username: string; // 用户名
  nickName: string; // 用户昵称
  roleName: string; // 角色列表
  // "deleted": false,  // 软删除
  // "password": "ed556265816011ba76a53e5cf54450cf", // 密码
  // "salt": "string", // 盐salt加密
  // "token": "string", // token
}
export type UserList = UserItem[];
export interface GetUserListApiResponse {
  total: number;
  items: UserList;
}
export interface AddUserApiParams
  // Pick 挑选
  // 从UserItem类型中挑选一些属性组成一个新类型
  extends Pick<UserItem, "username" | "nickName"> {
  password: string;
}

export interface UpdateUserApiParams extends AddUserApiParams {
  id: string;
}

export interface AddOrUpdateUserFormData extends AddUserApiParams {
  id?: string;
}

/*
根据用户获取角色数据
{
"assignRoles": [
      {
        "id": "1",
        "gmtCreate": "2022-01-01 00:00:00",
        "gmtModified": "2022-01-01 00:00:00",
        "deleted": false,
        "roleName": "平台管理员",
        "remark": null
      },
  ],
  "allRolesList": [
      {
        "id": "1",
        "gmtCreate": "2022-01-01 00:00:00",
        "gmtModified": "2022-01-01 00:00:00",
        "deleted": false,
        "roleName": "平台管理员",
        "remark": null
      },
  ]
}
*/

export interface RoleItem {
  id: string;
  gmtCreate: string;
  gmtModified: string;
  // "deleted": false,
  roleName: string;
  // "remark": null
}
export type RoleList = RoleItem[];
export interface GetToAssignApiResponse {
  assignRoles: RoleList;
  allRolesList: RoleList;
}
